package com.gitee.sop.websiteserver.mapper;

import com.gitee.fastmybatis.core.mapper.CrudMapper;
import com.gitee.sop.websiteserver.entity.PermIsvRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @author admin
 */
public interface PermIsvRoleMapper extends CrudMapper<PermIsvRole, Long> {

    /**
     * 删除指定应用的角色关系
     *
     * @param isvId 应用
     */
    @Select("delete from perm_isv_role where isv_id=#{isvId}")
    void deleteRoles(@Param("isvId") Long isvId);

    /**
     * 获取指定应用的权限列表
     *
     * @param isvId 应用
     * @return
     */
    @Select("select role_code from perm_isv_role where isv_id=#{isvId}")
    List<String> selectRoles(@Param("isvId") Long isvId);
}
